﻿using Coldairarrow.Entity.PB;
using Coldairarrow.Util;
using Coldairarrow.Util.ClassLibrary;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace Coldairarrow.Business.PB
{
    public partial interface IPB_LocationBusiness
    {
        
        Task<List<PB_Location>> GetDataListAsync();
        Task<PB_Location> GetTheDataAsync(string id);
        Task<AjaxResult> SelectLocationID(PB_LocationPrint data, MongoDBOptions _mongodbOptions);
        Task AddDataAsync(PB_Location data);
        Task UpdateDataAsync(PB_Location data);
        Task DeleteDataAsync(List<string> ids);
        //Task ModifyEnableAsync(string Id);
        Task AddDataExlAsync(List<PB_Location> list);
        // FileResult ExportToExcelWeb<T>(List<T> data, string head, string sheetName);

        /// <summary>
        /// 获取货位库存的详细信息
        /// </summary>
        /// <param name="locaId">货位Id</param>
        /// <returns></returns>
        Task<List<LocaMaterialDetailDTO>> GetLocaMaterialDetailAsync(string locaId);

        /// <summary>
        /// 打印仓库里货位对应的包码或物料码
        /// </summary>
        /// <param name="data"></param>
        /// <param name="PrinterId">打印机Id</param>
        /// <param name="_mongodbOptions"></param>
        /// <returns></returns>
        Task PrintPackCodeAsync(List<LocaMaterialDetailDTO> data,string PrinterId, MongoDBOptions _mongodbOptions);

    }

    public class LocaMaterialDetailDTO
    {
        public string Id { get; set; }

        /// <summary>
        /// 包Id
        /// </summary>
        public string PackId { get; set; }

        /// <summary>
        /// 包名称
        /// </summary>
        public string BoxName { get; set; }

        /// <summary>
        /// 物料Id
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string MaterialCode { get; set; }

        /// <summary>
        /// 物料规格
        /// </summary>
        public string MaterialSpec { get; set; }

        /// <summary>
        /// 货位信息
        /// </summary>
        public string LocalName { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public Double? Num { get; set; }

        /// <summary>
        /// 二维码
        /// </summary>
        public string QrCode { get; set; }

        /// <summary>
        /// 类型：0-包;1-物料;2-单个成品
        /// </summary>
        public int? Type { get; set; }

        /// <summary>
        /// 成品Id
        /// </summary>
        public string JobId { get; set; }
    }
   
}